﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="admin-materia.aspx.vb" Inherits="ASI_2_UFG.admin_materia" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
        }
        .style2
        {
            width: 59px;
            height: 23px;
        }
        .style3
        {
            height: 23px;
            width: 246px;
        }
        .style4
        {
            width: 246px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
    
        <table style="width: 38%;">
            <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style4">
                    Ingreso de Materias</td>
                <td rowspan="4">
                    <img alt="Materias" src="../IMAGES/note.png" 
                        style="width: 128px; height: 128px" /></td>
            </tr>
            <tr>
                <td class="style1">
                    Codigo :</td>
                <td class="style4">
                    <asp:TextBox ID="TxtCodigo" runat="server" MaxLength="4"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="ValidarCodigo" runat="server" 
                        ControlToValidate="TxtCodigo" ErrorMessage="Formato Incorrecto" 
                        ValidationExpression="^[a-zA-Z0-9]*$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Nombre:</td>
                <td class="style4">
                    <asp:TextBox ID="Txtnombre" runat="server" Width="233px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Estado:</td>
                <td class="style3">
                    <asp:DropDownList ID="cmbestado" runat="server">
                        <asp:ListItem Value="A">Activo</asp:ListItem>
                        <asp:ListItem Value="I">Inactivo</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style4">
                    <asp:ImageButton ID="btnagregar" runat="server" Height="77px" 
                        ImageUrl="~/IMAGES/funct_add.png" Width="83px" 
                        DescriptionUrl="~/IMAGES/funct_add.png" />
                    <asp:ImageButton ID="btnUpdate" runat="server" Height="71px" 
                        ImageUrl="~/IMAGES/funct_refresh.png" Visible="False" Width="83px" />
                    <asp:Button ID="Button1" runat="server" Text="Ingresar" Visible="False" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style4">
                    <asp:Label ID="Lblmensaje" runat="server" ForeColor="Red"></asp:Label>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="TxtCodigo" ErrorMessage="Codigo Requerido"></asp:RequiredFieldValidator>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="Txtnombre" ErrorMessage="Nombre Requerido"></asp:RequiredFieldValidator>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1" colspan="3">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" 
                        GridLines="None" Width="393px">
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:BoundField DataField="codigo" HeaderText="Codigo" 
                                SortExpression="codigo" />
                            <asp:BoundField DataField="nombre" HeaderText="Nombre" 
                                SortExpression="nombre" />
                            <asp:BoundField DataField="estado" HeaderText="Estado" 
                                SortExpression="estado" />
                            <asp:CommandField DeleteText="" EditText="Editar" ShowEditButton="True" />
                        </Columns>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ASI2UFG %>" 
                        SelectCommand="SELECT [codigo], [nombre], [estado] FROM [MATERIA] ORDER BY [nombre]">
                    </asp:SqlDataSource>
                </td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
